<?php
	
	
function money($number)
{
	if(is_numeric($number))
	{
		return number_format($number, 2, '.',',');
	}else{
		return number_format(intval($number), 2, '.',',');
	}
}

if(!function_exists('arrayToObject'))
{
	function arrayToObject($d)
	{
		if (is_array($d)) {
			/*
			* Return array converted to object
			* Using __FUNCTION__ (Magic constant)
			* for recursive call
			*/
			return (object) array_map(__FUNCTION__, $d);
		}else{
			// Return object
			return $d;
		}
	}
}